function legato = expan_legato(notes, i)

if (notes(i).ioi == 0)
    legato = 0;
    return;
end

legato = notes(i).dr / notes(i).ioi;
